<?php
/* @var $this UserRaoVatInfoController */
/* @var $model UserRaoVatInfo */
/* @var $form CActiveForm */
?>

<?php $form = $this->beginWidget('CActiveForm', array(
    'id' => 'user-rao-vat-info-form',
    'enableAjaxValidation' => false,
    'htmlOptions' => array(
        'role' => 'form',
        'class' => 'form-horizontal',
        'enctype' => 'multipart/form-data'
    )
)); ?>

<p class="note">Fields with <span class="required">*</span> are required.</p>

<?php if ($model->getErrors()) {
    ?>
    <div class="alert alert-error">
        <button class="close" data-dismiss="alert" type="button"> ×</button>
        <?php echo $form->errorSummary($model); ?>
    </div>
<?php } ?>
<div class="form admin-main-wrapper">
    <div class="block block-themed block-last">
        <div class="block-title">
            <h4></h4>
        </div>
        <div class="block-content">
            <div class="row control-group">
                <?php echo $form->labelEx($model, 'user_id', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'user_id'); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'user_name', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'user_name', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'first_name', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'first_name', array('size' => 60, 'maxlength' => 127)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'last_name', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'last_name', array('size' => 60, 'maxlength' => 127)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'address', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'address', array('size' => 60, 'maxlength' => 255)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'phone', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'phone', array('size' => 15, 'maxlength' => 15)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'mobile', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'mobile', array('size' => 15, 'maxlength' => 15)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'ym', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'ym', array('size' => 60, 'maxlength' => 100)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'skype', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'skype', array('size' => 60, 'maxlength' => 100)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'gtalk', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'gtalk', array('size' => 60, 'maxlength' => 100)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'msn', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'msn', array('size' => 60, 'maxlength' => 100)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'aol', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textField($model, 'aol', array('size' => 60, 'maxlength' => 100)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'about_me', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model, 'about_me', array('id' => 'txtAbout', 'rows' => 6, 'cols' => 50)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'signature', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->textArea($model, 'signature', array('id' => 'txtSignature', 'rows' => 6, 'cols' => 50)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'level', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php echo $form->dropDownList($model, 'level', array('0' => 0, '1' => 1)); ?>
                </div>
            </div>

            <div class="row control-group">
                <?php echo $form->labelEx($model, 'avata_url', array('class' => 'control-label')); ?>
                <div class="controls">
                    <?php if ($model->isNewRecord) { ?>
                        <?php echo $form->fileField($model, 'image'); ?>
                    <?php } else { ?>
                        <?php echo $model->avata_url != '' ? '<img src="' . TreTodayUrl::getPictureUrl($model->avata_url) . '">' : '' ?>
                        <?php echo $form->fileField($model, 'image'); ?>
                    <?php } ?>
                </div>
            </div>

            <div class="row control-group buttons">
                <div class="controls">
                    <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn btn-default')); ?>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->endWidget(); ?>

<script type="text/javascript">
    $(document).ready(function () {
        KindEditor.ready(function (K) {
            window.editor = K.create('#txtAbout', {
                langType: 'en',
                resizeMode: 1,
                height: 200,
                items: [
                    'bold', 'italic', 'underline',
                    'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                ]
            });

            window.editor = K.create('#txtSignature', {
                langType: 'en',
                resizeMode: 1,
                height: 200,
                items: [
                    'bold', 'italic', 'underline',
                    'removeformat', 'justifyleft', 'justifycenter', 'justifyright', 'insertorderedlist',
                ]
            });
        });
    });
</script>
